#
#
#
#
#

CC=arm-linux-gcc#
LD=arm-linux-ld#
AR=arm-linux-ar#
LDFLAGS=-g
ARFLAGS=-r
CFLAGS=-I ../../srl_include -I ../../srl_include/comm -I ../../srl_include/drv -I ../../srl_include/head -I ../../srl_include/int -I ../../srl_include/kernel

vpath %.h ../../srl_include
vpath %.h ../../srl_include/comm
vpath %.h ../../srl_include/drv
vpath %.h ../../srl_include/head
vpath %.h ../../srl_include/int
vpath %.h ../../srl_include/kernel

TASK_TAG=k_task.a# use static library
TASK_OBJ=task.o process.o thread.o task_communicate.o task_idmgr.o
TASK_SRC=$(TASK_OBJ:.o=.c)
TASK_DEP=$(TASK_OBJ:.o=.d)

$(TASK_TAG):$(TASK_OBJ) $(TASK_DEP)
	$(AR) $(ARFLAGS) $@ $(TASK_OBJ)

dep:$(TASK_DEP)
$(TASK_DEP):%.d:%.c
	rm -f $*.d;\
	gcc $(CFLAGS) -MM $<|sed 's,^.*:,$*.o:,' >log.$$$$1;\
	echo $(CC) $(CFLAGS) -c $< -o $*.o >log.$$$$2;\
	cat log.$$$$1 log.$$$$2|sed 's/^$(CC)/\t$(CC)/g' >$@;\
	rm -f log.$$$$*;\

include $(TASK_OBJ:.o=.d)

clean:
	rm -f $(TASK_DEP) $(TASK_OBJ) $(TASK_TAG)

